export async function getAllRole() {
    return await new Promise((resolve, reject) => {
        axios.get('/index/role/allRole').then(res => {
            resolve(res.data.data);
        }).catch(err => {
            reject(err);
        });
    });
}

export async function getSys() {
    return await new Promise((resolve, reject) => {
        axios.get('/index/index/getSys').then(res => {
            resolve(res.data.data);
        }).catch(err => {
            reject(err);
        });
    });
}

export async function getAuthList(parmas) {
    return await new Promise((resolve, reject) => {
        axios.get('/index/setAuth/getAuthList', parmas).then(res => {
            resolve(res);
        }).catch(err => {
            reject(err);
        });
    });
}

export async function setAuth(params) {
    return await new Promise((resolve, reject) => {
        axios.post('/index/setAuth/setAuth', params).then(res => {
            resolve(res);
        }).catch(err => {
            reject(err);
        });
    });
}
